//
// Created by Wirano on 2020/11/9.
//

#ifndef ANO_PORT_ANO_RC_H
#define ANO_PORT_ANO_RC_H

#include "Ano_FcData.h"

typedef struct//波动次数结构体
{
    uint16_t s_cnt;
    uint8_t s_now_times;
    uint8_t s_state;
} _stick_f_c_st;

#define _stick_f_lp_st uint16_t //长按

enum {
    CH1 = 0,
    CH2,
    CH3,
    CH4,
    CH5,
    CH6,
    CH7,
    CH8
};


extern int16_t CH_N[], RX_CH[CH_NUM];
extern uint16_t signal_intensity;
extern uint8_t chn_en_bit;

//static
void fail_safe_check(uint8_t dT_ms);

void stick_function(uint8_t dT_ms);

void stick_function_check_longpress(uint8_t dT_ms, uint16_t *time_cnt, uint16_t longpress_time_ms, uint8_t en,
                                    uint8_t trig_val, uint8_t *trig);

static void ch_watch_dog(uint8_t dT_ms);


//public
void Remote_Control_Init(void);

void RC_duty_task(uint8_t dT_ms);

void signal_check_task(uint8_t);

void ch_watch_dog_feed(uint8_t ch_n);

#endif //ANO_PORT_ANO_RC_H
